const { Schema, SchemaTypes } = require('../schema');

/**
 * 用户推广账户
 */
class PromoteAccount extends Schema {
    PropertyModelDataTemplate () {
        return {
            userId: { type: SchemaTypes.ObjectId, required: true },
            // 分销类型：固定金额，按比例抽成
            promoteType: { type: SchemaTypes.Number, required: true },
            promoteValue: { type: SchemaTypes.Number, required: true },
            // 金币数量
            coinCount: { type: SchemaTypes.Number, required: true, default: 0 },
            areaId: { type: SchemaTypes.ObjectId, required: false },

            createTime: { type: SchemaTypes.Number, required: true, default: require('../../module/tool/time').getCurrentTimestamp() }
        };
    }
}

module.exports = PromoteAccount;
